package com.example.demo.Controller;

import com.example.demo.Service.LoginService;
import com.example.demo.entity.Device;
import com.example.demo.entity.Login;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/Login")
@RestController
public class LoginController {
    @Autowired
    LoginService loginService;
    @GetMapping("/query")
    public List<Login> get(){
        return loginService.list();
    }

    @PostMapping("/add")
    public void add(@RequestBody Login login){
        loginService.save(login);
    }
}
